<template>
    <div>
        <el-form :model="ruleForm"  ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-form-item label="联系人" prop="shopname">
                <el-input v-model="ruleForm.shopname" readonly></el-input>
            </el-form-item>
            <el-form-item label="联系电话" prop="shoptel">
                <el-input v-model="ruleForm.shoptel" readonly></el-input>
            </el-form-item>
            <el-form-item label="店铺名" prop="shoptel">
                <el-input v-model="ruleForm.branchname" readonly></el-input>
            </el-form-item>
            <el-form-item label="店铺描述" prop="shoptel">
                <el-input v-model="ruleForm.branchdescrible" readonly></el-input>
            </el-form-item>
            <el-form-item label="经营品类" prop="shoptype">
                <el-input v-model="ruleForm.btname" readonly></el-input>
            </el-form-item>
            <el-form-item label="门店类型" prop="branchtype">
                <el-input v-model="ruleForm.branchtype" readonly></el-input>
            </el-form-item>
            <el-form-item label="门店图片" prop="branchtype">
                <img :src="ruleForm.shopurl" />
            </el-form-item>

            <el-form-item label="身份证图片" prop="branchtype">
                <img :src="ruleForm.personcardurl" />
            </el-form-item>

            <el-form-item label="营业执照" prop="branchtype">
                <img :src="ruleForm.businesslicenseurl" />
            </el-form-item>

            <el-form-item label="经营许可证" prop="branchtype">
                <img :src="ruleForm.coaurl" />
            </el-form-item>

            <el-form-item>
                <div v-if="ruleForm.examstate==1">
                    <el-button type="primary" @click="submitForm">审核通过</el-button>
                    <el-button @click="resetForm">驳回</el-button>
                </div>
                <div v-else>
                    <el-button type="primary" @click="fanhui">返回</el-button>
                </div>
            </el-form-item>
        </el-form>

<!--        点击驳回获取弹窗-->
        <el-dialog
                title="信息"
                :visible.sync="rejectdialogFormVisible">
            <el-form :model="rejectForm">
                <el-form-item label="驳回理由">
                    <el-input v-model="rejectForm.remarks" ></el-input>
                </el-form-item>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="rejectdialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="rejectOutlibrarySure">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    export default {
        name: "QualificationReview",
        data(){
            return{
                ruleForm:{},
                options: [],
                props:{
                    value:'btid',
                    label:'btname',
                    children:'children',

                    multiple:false
                },
                //获取驳回理由
                rejectForm:{},
                rejectdialogFormVisible:false,

            }
        },
        created() {
            this.ruleForm = this.$route.params.row;
            console.log(this.ruleForm)
            //this.inintFindAll();
        },
        methods:{
            //审核通过
            submitForm(){
                console.log(this.ruleForm)
                this.$http.post("/settled/settledlibrary/insertUserByRoleBySettled",this.ruleForm).then(result => {
                    console.log(result)
                    if (result.data.code===2000){
                        this.$message.success(result.data.msg)
                        setTimeout(() => {
                            this.$router.push("/acl/branchallauditing/list");
                        },1000)
                    }
                })
                //this.$router.push("/acl/branchallauditing/list")
            },
            handleChange(value) {
                console.log(value);
            },
            fanhui(){
                this.$router.push("/acl/branchallauditing/list")
                //this.$router.back()
            },
            //点击驳回弹窗层并获取该行数据
            resetForm(){
                this.rejectdialogFormVisible=true;
            },
            rejectOutlibrarySure(){
                this.rejectdialogFormVisible=false;
                this.ruleForm.remarks= this.rejectForm.remarks
                this.ruleForm.examstate = 3
                console.log("_________++++++++++++++_____________")
                // console.log(this.rejectOutlibraryForms)
                console.log(this.ruleForm)
                console.log("###################")
                var that = this;
                this.$http.post("/settled/settledlibrary/updateSettledState",this.ruleForm).then(function (result){
                    console.log("\\\\\\\\\\\\\\\\");
                    console.log(result)
                    if (result.data.code===2000){
                        that.$message.success(result.data.msg)
                        setTimeout(() => {
                            this.$router.push("/acl/branchallauditing/list");
                        },1000)
                    }
                })

    }
        }
    }
</script>

<style scoped>
    img{
        width: 400px;
        height: 300px;
    }
</style>